package com.detection.common.perimeter.hikvision;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @author LH
 * @date 2022/10/26 17:14
 */
public class SectorsEventType {

    private static Map<Integer,String> maps = new LinkedHashMap<>();

    private static void init() {
        maps.clear();
        maps.put(1, "断线");
        maps.put(2, "短路");
    }

    public static String get(Integer type){
        loadData();
        return maps.get(type);
    }

    private static void loadData() {
        if (maps.isEmpty()) {
            init();
        }
    }

    public static List<String> getTypeNames(){
        loadData();
        return new ArrayList<>(maps.values());
    }

    public static List<Integer> getKeys(){
        loadData();
        return new ArrayList<>(maps.keySet());
    }

}
